From b824cdd6dbce65b54321f6a1d24e518a3d8b5c00 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 21 Dec 2010 18:42:30 -0500 Subject: [PATCH] Fix a blunder in grab handling This was causing segfaults which would go away when compiled with debug options. --- gdk/x11/gdkdisplay-x11.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index f5f00527fd..20405bddc5 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -1588,6 +1588,16 @@ struct XPointerUngrabInfo { guint32 time; }; +static void +device_grab_update_callback (GdkDisplay *display, + gpointer data, + gulong serial) +{ + GdkDevice *device = data; + + _gdk_display_device_grab_update (display, device, NULL, serial); +} + #define XSERVER_TIME_IS_LATER(time1, time2) \ ( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \ (( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \ @@ -1599,9 +1609,7 @@ _gdk_x11_display_update_grab_info (GdkDisplay *display, gint status) { if (status == GrabSuccess) - _gdk_x11_roundtrip_async (display, - (GdkRoundTripCallback)_gdk_display_device_grab_update, - device); + _gdk_x11_roundtrip_async (display, device_grab_update_callback, device); } void @@ -1621,9 +1629,7 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display, !XSERVER_TIME_IS_LATER (grab->time, time))) { grab->serial_end = serial; - _gdk_x11_roundtrip_async (display, - (GdkRoundTripCallback)_gdk_display_device_grab_update, - device); + _gdk_x11_roundtrip_async (display, device_grab_update_callback, device); } } -- 2.30.2